package com.wj.LightActivity;

import android.content.Context;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;

public class SaveInstance {
	private void saveInstance(Context paramContext, String paramString,
			boolean paramBoolean) {
		SharedPreferences.Editor localEditor = paramContext
				.getSharedPreferences("lightSetting", 0).edit();
		localEditor.putBoolean(paramString, paramBoolean);
		localEditor.commit();
	}
	
	public boolean getScreenOn(Context paramContext) {
		return PreferenceManager.getDefaultSharedPreferences(paramContext)
				.getBoolean("screen_on", true);
	}

	public boolean getAutoOff(Context paramContext) {
		return PreferenceManager.getDefaultSharedPreferences(paramContext)
				.getBoolean("auto_off", false);
	}

	public boolean getAutoOn(Context paramContext) {
		return PreferenceManager.getDefaultSharedPreferences(paramContext)
				.getBoolean("auto_on", false);
	}
	
	public boolean getAnimOpen(Context paramContext) {
		return PreferenceManager.getDefaultSharedPreferences(paramContext)
				.getBoolean("anim_open", false);
	}
	
	public String getOpenNotify(Context paramContext) {
		return PreferenceManager.getDefaultSharedPreferences(paramContext)
				.getString("open_notify", "unknown");
	}
	
	public String getCloseNotify(Context paramContext) {
		return PreferenceManager.getDefaultSharedPreferences(paramContext)
				.getString("close_notify", "unknown");
	}

	public boolean getScreenStatus(Context paramContext) {
		return paramContext.getSharedPreferences("lightSetting", 0).getBoolean(
				"screen_statu", true);
	}

	public void setScreenStatu(Context paramContext, boolean paramBoolean) {
		saveInstance(paramContext, "screen_statu", paramBoolean);
	}
}